#include "main_init.h"
#include "hal_spi.h"
#include "smart_pwm.h"
#include "led_hw.h"
#include "Mcu_lld.h"
#include "sys.h"
#include "hal_stm.h"
#include "time_tick.h"
/*
 * 函数介绍: 系统初始化函数
 * 参数:
 * 返回值: {*}
 * 备注:
 */
void system_init(void)
{
	INTC_IRQ_Disable();
    /* Disable WatchDog */
    SWT_DisableWatchDog();

    /* System Initialisation */
    Mcu_Init(&McuConfig_PC);

    /*1ms time初始化*/
    //hal_stm_init(STM_CHANNEL0,10000,tick_1ms,HAL_ENABLE);
    STM_TEST_Demo();
    TimeTick_Init();

    /*can初始化*/
    hal_can_init_test();

    /*spi初始化*/
    //hal_spi_init(DSPI0,2000000,SPI_INACTIVE_HIGH,SPI_CPOL0_CPHA0,HAL_ENABLE);
    Spi_Test_Demo();

    /* LED Initialisation */
    LED_SIU_Init();
    LED_Set(LED1|LED2|LED3, LED_OFF);
    INTC_IRQ_Enable();
}

/*
 * 函数介绍: 应用层初始化函数
 * 参数:
 * 返回值: {*}
 * 备注:
 */
void module_init(void)
{
    led_control_init();
    //led_control_test();
}
